
import React from 'react';

export default class Header extends React.Component {

  render() {
    var wechat = (this.props.wechat&&this.props.wechat.length > 0)? this.props.wechat[0]:null;
      return (
        <header className="header">
          <ul className="nav navbar-nav navbar-left" >
            <li className="dropdown user-info">
              <a href="#" className="dropdown-toggle dropdown-logo" dataToggle="dropdown">
                <p className="">{(wechat && wechat.name && wechat.name.length > 0)? wechat.name:"嘉里集团"}
                  <span className="caret f-dn"></span>
                </p>
              </a>
            </li>
          </ul>
          <ul className="nav navbar-nav navbar-right" >
            <li className="dropdown user-info">
              <a href="#" className="dropdown-toggle" dataToggle="dropdown">
                <div className="avatar f-dn">
                  <img className="border-white" src={this.props.avatar} />
                </div>
                <p>{this.props.name + "， 欢迎回来"}
                  <span className="caret f-dn"></span>
                </p>
              </a>
            </li>
            <li>
              <a className="exitBtn" href="/logout">退出</a>
            </li>
          </ul>
        </header>
      );
  }
}
